import { createRouter, createWebHashHistory, createWebHistory } from "vue-router";
import HomeView from "@/views/HomeView.vue";

const router = createRouter({
  history: createWebHashHistory(),
  //history: createWebHistory(),
  routes: [
    {
      path: "/",
      name: "HomeView",
      component: HomeView,
      redirect: "/situationOverview",
      children: [
        {
          path: "/situationOverview",
          name: "SituationOverview",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("@/views/situation/SituationView.vue"),
        },
        {
          path: "/urbanRuralCommunity",
          name: "urbanRuralCommunity",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("@/views/urbanRuralCommunity/index.vue"),
        },
        {
          path: "/siteCodeManage",
          name: "SiteCodeManage",
          component: () =>
            import("@/views/siteCodeManage/SiteCodeManageView.vue"),
        },
        {
          path: "/PopulationOverview",
          name: "PopulationOverview",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () =>
            import("@/views/populationInformation/populationView.vue"),
        },
        {
          path: "/naTest",
          name: "naTest",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("@/views/naTest/index.vue"),
        },
        {
          path: "/returnTown",
          name: "returnTown",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () => import("@/views/returnTown/index.vue"),
        },
        {
          path: "/OneKeySearchView",
          name: "OneKeySearchView",
          // route level code-splitting
          // this generates a separate chunk (About.[hash].js) for this route
          // which is lazy-loaded when the route is visited.
          component: () =>
            import("@/views/oneKeySearch/oneKeySearchView.vue"),
        },
        {
          path: "/LeafletDemo",
          name: "LeafletDemo",
          component: () =>
            import("@/views/demo/Leaflet.vue"),
        },
        {
          path: "/VideoDemo",
          name: "VideoDemo",
          component: () =>
              import("@/views/demo/Video.vue"),
        }
        // {
        //   path: "/populationInformation",
        //   name: "PopulationInformation",
        //   component: () =>
        //     import("@/views/populationInformation/populationView.vue"),
        // },
      ],
    },
  ],
});

export default router;
